import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'UserManage',
    component: () => import('../views/UserManage'),
    redirect: '/home',
    children: [
      {path:'home', name:'Home', component: () => import('../views/Home.vue')},
      {path:'user', name:'User', component: () => import('../views/sys/user/User.vue')},
      {path:'role', name:'Role', component: () => import('../views/sys/role/Role.vue')},
      {path:'menu', name:'Menu', component: () => import('../views/sys/menu/Menu.vue')},
      {path:'file', name:'File', component: () => import('../views/sys/file/File.vue')},
      {path:'stock', name:'Stock', component: () => import('../views/business/stock/Stock.vue')},
      {path: 'stockForm', name: 'StockForm', component: () => import('@/views/business/stock/StockForm.vue')},
      {path: 'stockView', name: 'StockView', component: () => import('@/views/business/stock/StockView.vue')},
      {path: 'stockRevenueQuarter', name: 'StockRevenueQuarter', component: () => import('@/views/business/stockrevenuequarter/StockRevenueQuarter.vue')},
      {path: 'stockRevenueQuarterForm', name: 'StockRevenueQuarterForm', component: () => import('@/views/business/stockrevenuequarter/StockRevenueQuarterForm.vue')},
      {path: 'stockRevenueQuarterView', name: 'StockRevenueQuarterView', component: () => import('@/views/business/stockrevenuequarter/StockRevenueQuarterView.vue')},
      {path: 'stockProfit', name: 'StockProfit', component: () => import('@/views/business/stockprofit/StockProfit.vue')},
      {path: 'stockProfitForm', name: 'StockProfitForm', component: () => import('@/views/business/stockprofit/StockProfitForm.vue')},
      {path: 'stockProfitView', name: 'StockProfitView', component: () => import('@/views/business/stockprofit/StockProfitView.vue')},
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/sys/user/Login')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/sys/user/Register.vue')
  },
  {
    path: '*',
    name: '404',
    component: () => import('../views/404.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
